Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes To Target Traces #2016

Merged
merged 4 commits into from
Jul 8, 2018
Merged

Conversation

BlythMeister
Copy link
Contributor

  • Update logic for marking success/failure on Target tracing
  • Allow target traces to pass string option but not be breaking change to all other traces

@BlythMeister
Copy link
Contributor Author

BlythMeister commented Jul 5, 2018

@matthid #2009 had an issue with the final and failure targets tracing
In particular failure targets which report they fail...because a previous target had failed (that's why it's running 😉)

I also noticed you reverting the breaking changes, so helped a bit with that too 👍

let traceTarget name description dependencyString =
traceStartTargetUnsafe name description dependencyString
traceStartTargetUnsafe name (optionDescriptionToNullable description) dependencyString
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this changes the public API of traceTarget. We could argue that traceTarget is for internal use only but...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could maybe add an traceTargetInternal and add a obsolete attribute stating "this feature is for internal use only". On the other hand others (like Xake for example) might want to use this API... So we should probably consider it public

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my argument 😆

I was also tempted to put the internal modifier, but then because of modules we can't since targets are not internal to trace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i'll revert this then and have the narly logic in targets :(

@@ -50,6 +50,10 @@ and [<NoComparison>] [<NoEquality>] TargetContext =
member x.HasError =
x.PreviousTargets
|> List.exists (fun t -> t.Error.IsSome)
member x.LastTargetError =
x.PreviousTargets
|> List.last
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strictly speaking LastTargetError needs to be a bool option as the PreviousTargets list might be empty...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh your so right...fixing now

let res = runSimpleContextInternal target context
if res.HasError
if res.LastTargetError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way would be to let runSimpleContextInternal return the state of the target it executed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooooh even nicer!

@matthid
Copy link
Member

matthid commented Jul 5, 2018

Should we add a test for the scenario this fixes?

@BlythMeister
Copy link
Contributor Author

It fixes the trace message...not sure how to test that...

@matthid matthid merged commit b8483ea into fsprojects:release/next Jul 8, 2018
@BlythMeister BlythMeister deleted the tracing2 branch May 11, 2021 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants